
const koa = require('koa');
const bodyParser = require('koa-bodyparser')
const logger = require('koa-logger');
const serve = require('koa-static');
const cors = require('koa2-cors');
const path = require('path');

const app = new koa();
let myRouter = require("./router");

const port = 9098


app.use(bodyParser())
    .use(logger())
    .use(cors())
    .use(myRouter.routes())
    .use(myRouter.allowedMethods())
    .use(serve(path.join(__dirname, '/static')))

    .listen(port, function () {
        console.log(`\n\n listening on port ${port} \n\n`);
    });